home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 6139 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.3 KB

  1. Path: news1.interserv.net!news
  2. From: <dvisage@interserv.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: ifstream seek problem
  5. Date: 11 Feb 1996 21:50:09 GMT
  6. Organization: InterServ News Service
  7. Message-ID: <4floah$101@lal.interserv.net>
  8. NNTP-Posting-Host: dd06-002.compuserve.com
  9. Content-Type: text/plain
  10. Content-length: 2070
  11. X-Newsreader: AIR Mosaic (32-bit) 4.00
  12.  
  13.  
  14.  Matthias Sodomann <Matthias.Sodomann@dlr.de> writes:
  15. >Hi there,
  16. >
  17. >I have a question concerning ifstream operation. I like to read a file.
  18. >It is ASCII. I got me an ifstream in; and opened the file with
  19. >in.open("filename",ios::in); So far so good. I read the whole file, and
  20. >after this I have to read it again. The reason doesn't matter! How do I
  21. >reset the file to start reading from the beginning WITHOUT closing and
  22. >reopening it? I tried to use in.seekg(0); or in.seekg(0,ios:beg); but
  23. >all this didn't help. What do I have to do? Or is this maybe a matter of
  24. >compiler? I work on a IBM RS600 AIX3.2 Workstation with the IBM C++
  25. >Compiler xlC.
  26. >
  27. >
  28. >I hope, and think, it is an easy problem.
  29. >
  30. >ThanX for reading this. Please give me some advice.
  31. >
  32. >Matthias
  33. >-- 
  34. >
  35. >========================================================================
  36. >|  Matthias Sodomann | Phone:                       (+49)2203-601-2928 |
  37. >|  DLR               | FAX:                            (+49)2203-68309 |
  38. >|  Linder Hoehe 90   | E-mail:                Matthias.Sodomann@dlr.de |
  39. >|D-51147 Koeln       | InterNet / WWW:   http://dv.kp.dlr.de/~sodomann |
  40. >|  Germany           | anonymous ftp:                    129.247.108.3 |
  41. >========================================================================
  42. >|                                                                      |
  43. >|                _/_/_/   _/       _/_/_/         //|                  |
  44. >|               _/    _/ _/       _/    _/    ___// |___               |
  45. >|              _/    _/ _/       _/_/_/_/   //___/  /__//              |
  46. >|             _/    _/ _/       _/  _/          || /                   |
  47. >|            _/_/_/   _/_/_/_/ _/    _/         ||/                    |
  48. >|                                                                      |
  49. >========================================================================
  50. There is another member of ifstream that you may be able to use instead
  51. of seekg().  Look up seekoff, I think it takes similar parameters as seekg().
  52.  
  53.